package com.qxbb.report.controller;

import com.qxbb.report.service.NewsService;
import com.qxbb.report.utils.http.HttpResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @version 1.0
 * @author: pebble
 * @data 2023/10/19 10:34
 */
@RestController
@RequestMapping("news")
@CrossOrigin
public class NewsController {

    Logger logger = LoggerFactory.getLogger(LoginController.class);


    @Autowired
    private NewsService newsService;

    /**
     * 新闻列表信息查询
     * @return
     */
    @GetMapping("/list")
    public HttpResult selectNewsList(){
        logger.info(this.getClass() + ".selectNewsList 新闻列表信息查询");
        return HttpResult.ok(newsService.selectNewsList());
    }


}
